Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Remove scoped visibility from the docs engine#383

Merged
ptgott merged 2 commits into
mainfrom
paul.gottschling/2023-08-21-no-scopes
Sep 6, 2023
Merged

Remove scoped visibility from the docs engine#383
ptgott merged 2 commits into
mainfrom
paul.gottschling/2023-08-21-no-scopes

Conversation

@ptgott
Copy link
Copy Markdown
Contributor

@ptgott ptgott commented Aug 23, 2023

Closes gravitational/teleport#19471
Closes gravitational/teleport#30381
Closes #343
Closes #162
Closes #155
Closes #118
Closes #116
Closes #88

Users tend not to notice the scope switcher. When they do, the
component's behavior is not intuitive. This change removes the scope
switcher from the docs, replacing it with a non-interactive list of
supported Teleport editions.

The change preserves the existing styling of the scope switcher as much
as possible. Aside from an "Available for" label next to the edition
list, the change should go unnoticed for users who do not interact with
the scope switcher.

This change also adjust some docs behavior that relied on the scope
switcher:

  • The DocsContext no longer includes the current scope: Components
    no longer refer to the DocsContext to determine the currently
    selected scope and adjust their visibility.

    "Box" components like the Details, Notice, and Admonition
    component can currently hide themselves if the selected scope does not
    match the value of the scope prop. This change shows these boxes at
    all times, but keeps the scope and scopeOnly props for backwards
    compatability (the props are no-op).

    The Tabs component currently uses the selected scope to select a
    TabItem with the scope property. Since we merged Switch TabItems with identical labels together #380, though,
    Tabs components can preserve most of this behavior without the scope
    switcher, as long as these components include identical labels for
    edition-related tab items. This change also retains the scope prop
    in no-op form.

  • Locking the version picker if the scope is cloud or team: This
    change no longer locks the version picker, since there is no way to
    select a scope. Locking the version picker becomes an issue when
    Teleport Cloud is a major version behind the latest release. Removing
    the scope switcher doesn't completely rectify this, since the version
    of the docs for the previous version includes a warning banner. We can
    address this in a future change.

@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 5, 2023 7:32pm

Closes #343
Closes #162
Closes #155
Closes #118
Closes #116
Closes #88

Users tend not to notice the scope switcher. When they do, the
component's behavior is not intuitive. This change removes the scope
switcher from the docs, replacing it with a non-interactive list of
supported Teleport editions.

The change preserves the existing styling of the scope switcher as much
as possible. Aside from an "Available for" label next to the edition
list, the change should go unnoticed for users who do not interact with
the scope switcher.

This change also adjust some docs behavior that relied on the scope
switcher:

- **The `DocsContext` no longer includes the current scope:** Components
  no longer refer to the `DocsContext` to determine the currently
  selected scope and adjust their visibility.

  "Box" components like the `Details`, `Notice`, and `Admonition`
  component can currently hide themselves if the selected scope does not
  match the value of the `scope` prop. This change shows these boxes at
  all times, but keeps the `scope` and `scopeOnly` props for backwards
  compatability (the props are no-op).

  The `Tabs` component currently uses the selected scope to select a
  `TabItem` with the `scope` property. Since we merged #380, though,
  `Tabs` components can preserve most of this behavior without the scope
  switcher, as long as these components include identical labels for
  edition-related tab items. This change also retains the `scope` prop
  in no-op form.

- **Locking the version picker if the scope is `cloud` or `team`**: This
  change no longer locks the version picker, since there is no way to
  select a scope. Locking the version picker becomes an issue when
  Teleport Cloud is a major version behind the latest release. Removing
  the scope switcher doesn't completely rectify this, since the version
  of the docs for the previous version includes a warning banner. We can
  address this in a future change.
@ptgott ptgott force-pushed the paul.gottschling/2023-08-21-no-scopes branch from e483eb0 to 315c611 Compare August 23, 2023 19:14
@ptgott
Copy link
Copy Markdown
Contributor Author

ptgott commented Aug 23, 2023

Reviewer notes:

image

@ptgott ptgott marked this pull request as ready for review August 23, 2023 19:18
@ptgott ptgott requested a review from avatus as a code owner August 23, 2023 19:18
avatus
avatus previously approved these changes Aug 24, 2023
Copy link
Copy Markdown
Contributor

@avatus avatus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good but lets await some product approvals as well

@xinding33
Copy link
Copy Markdown

This change looks good to me for a short-term fix. Long term, as we've discussed internally, I'd rather revamp the information architecture.

xinding33
xinding33 previously approved these changes Sep 5, 2023
@ptgott ptgott merged commit 971027e into main Sep 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

4 participants